// eslint-disable-next-line
import { BasicLayout, BlankLayout, PageView, RouteView, UserLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

/**
 * 菜单所需要的字段
 * @type {*[]}
 * path
 * meta : {
 *   title: '首页',
 *   keepAlive: true,
 *   icon: bxAnaalyse
 * }
 * hidden: 可以在菜单中不展示这个路由，包括子路由
 * hideChildrenInMenu: 隐藏不需要在菜单中展示的子路由
 * children: [
 *
 * ]
 *
 */
export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/boms/product',
    children: [
      {
        path: '/dashboard',
        name: 'dashboard',
        redirect: '/dashboard/analysis',
        component: RouteView,
        hidden: true,
        meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse },
        children: [
          {
            path: 'analysis',
            name: 'Analysis',
            component: () => import('@/views/dashboard/Analysis'),
            meta: { title: '工作台', keepAlive: false }
          }
        ]
      },
      {
        path: '/boms',
        name: 'boms',
        component: RouteView,
        meta: { title: 'bom', keepAlive: true, icon: bxAnaalyse },
        children: [
          {
            path: 'product',
            name: 'product',
            component: () => import('@/views/modules/product/Product'),
            meta: { title: '产品管理', keepAlive: false }
          },
          {
            path: 'ShowBoms',
            name: 'ShowBoms',
            component: () => import('@/views/modules/product/ShowBoms'),
            hidden: true,
            meta: { title: '显示', keepAlive: false }
          }
        ]
      }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]
